package com.system.vote.admin.aspect;

import com.google.common.util.concurrent.RateLimiter;
import org.springframework.stereotype.Component;

@Component
public class RateLimiterUtil {
    private static final int MAX_REQUESTS_PER_MINUTE = 100;
    private static final RateLimiter rateLimiter = RateLimiter.create(MAX_REQUESTS_PER_MINUTE);

    public boolean isAllowed() {
        return rateLimiter.tryAcquire();
    }
}
